1. Field of the Invention
The present invention relates to computer systems and, more particularly, to bus control for computer systems.
2. Description of the Related Art
Computer systems typically include a bus over which data and control signals are exchanged with peripheral devices. These buses are often categorized as either parallel buses or serial buses. Parallel buses include multiple data lines, whereas serial buses include a single data line (or a differential pair of lines). Examples of parallel buses are Interface Standard Association (ISA) and Peripheral Component Interface (PCI). Examples of serial buses are Apple Desktop Bus (ADB), Access.bus, IEEE P1394, Concentration Highway Interface (CHI), and GeoPort.
Recently, a serial bus known as Universal Serial Bus (USB) has been developed. USB is an industry standard extension to the personal computer architecture with a focus on Computer Telephony Integration (CTI), consumer and productivity applications. The USB is described in a Universal Serial Bus Specification, Revision 1.0, dated Jan. 15, 1996, which is hereby incorporated by reference.
USB is a cable bus that supports data exchange between a host computer and a wide range of simultaneously accessible peripherals. The USB bus is a four wire bus, with a power line (Vbus), a ground line (GND), and two data lines (VD+ and VDxe2x88x92). Data is transmitted over the data lines in a differential manner. The peripherals attached to a USB share the bandwidth of the USB through a host scheduled token based protocol. The USB specification allows peripherals to be attached, configured, used and detached while the host and other peripherals are in operation. Such is often referred to as dynamic (or hot) attachment and removal.
A USB bus connects USB devices with a USB host. A host controller interfaces the USB bus to the host computer system. The host controller may be implemented in a combination of hardware, firmware or software. The USB host interacts with the USB devices through the host controller. The host and its associated host controller are responsible for managing the use of the USB. Specifically, the host is responsible for detecting the attachment and removal of USB devices, managing control flow between the host and USB devices, managing data flow between the host and USB devices, collecting status and activity statistics, and providing a limited amount of power to attached USB devices.
USB devices are peripheral devices that add additional functionality to the host computer. The types of functionality provided by the USB devices varies widely. To assist the USB host in identifying and configuring USB devices, each USB device carries and reports configuration related information. Some of the information reported is common to all logical devices, while other information is specific to the functionality provided by the device. Before a peripheral device can be used, it must be configured by the host. This configuration includes allocating USB bandwidth and selecting function specific configuration options. Examples of functions provided by peripheral devices include: locator devices such as a mouse, tablet, or light pen; input devices such as a keyboard; output devices such as a printer or scanner; and telephony adapters such as an ISDN adapter.
The USB specification also covers power management aspects. Each USB segment provides a limited amount of power over the cable. The host supplies power for use by USB devices that are directly connected to the host. In addition, any USB device may have its own power supply. USB devices that rely totally on the power from the cable are called bus-powered devices. In contrast, those USB devices that have an alternate source of power are called self-powered devices.
A USB host has a power management system which is independent from that of USB. The USB system software interacts with the host""s power management system to handle system power events such as Suspend or Resume. In particular, USB allows the host computer to command connected USB devices to enter a low-power Suspend state. A suspended full-speed device pulls the VD+ data line high, while the host""s pull-down resistor to ground pulls the VDxe2x88x92 data line low. Similarly, a suspended low-speed device pulls the VDxe2x88x92 line high, while the host""s pull-down resistor to ground pulls the USB VD+ data line low. The state of the USB bus when a suspended device is connected is also called the Idle state. When a suspended device experiences a wakeup event (such as a key press, modem ring detect, etc.), it generates a Resume event by driving the low data line high and driving the high data line low. Normally, the host computer""s USB circuitry detects the Resume event, and resumes normal USB communication with the device.
When a device is unplugged from a USB port, the host computer""s pull-down resistors cause both data lines to be pulled low. The host computer""s USB circuitry detects this as a disconnect event. If a device is later plugged into the port, the device pulls one of the data lines high. The particular one of the data lines pulled high depends on whether it is a full-speed or a low-speed device. The host computer""s USB circuitry detects this connect event, and begins USB communication with the device.
However, all of these operations require the host computer""s USB circuitry to be awake (powered and clocked) at all times, in order to detect resume, disconnect or connect events. In many cases, especially in portable computers or other battery-powered devices, it is desirable to shut down the USB circuitry (stop its clocks and possibly turn off its power) when it is not needed so as to reduce the host computer""s power consumption. For example, this might occur when the host computer is in a sleep state, or when no USB devices are presently connected to the host computer. Although such power management advantageously reduces power consumption and thus extends battery life, a serious problem is presented because these bus events (resume, connect and disconnect) are not able to be detected when the host computer""s USB circuitry has been shut down. This problem leads to improper operation of the host computer, namely, unresponsiveness to bus events, and thus user dissatisfaction.
Thus, there is a need for improved bus control such that peripheral devices can utilize a bus even though the host bus circuitry for the bus is shut down for power management.
Broadly speaking, the invention relates to apparatus and techniques for awakening bus circuitry from an inactive state as needed. The bus circuitry forms part of a computer system and is placed in the inactive state (i.e., shut down) when not needed so as to conserve power. The bus circuitry is associated with a bus and can be awakened out of the inactive state when certain bus events, including resume, connect or disconnect, occur on the bus. The invention is particularly advantageous for battery-powered computing devices (e.g., portable computers) where it is desirous to shut down bus circuitry as well as other circuitry (e.g., microprocessor) when not needed so as to reduce power consumption.
The invention can be implemented in numerous ways, including as a system, a device, an apparatus, and a method. Several embodiments of the invention are summarized below.
As a computer system, one embodiment of the invention includes: a memory for storing at least instructions; a microprocessor for processing the instructions stored in the memory, the microprocessor having an active state and a sleep state; a peripheral bus; a bus host controller for managing data transfer over the peripheral bus, the bus host controller having an operational mode and a shut-down mode, the shut-down mode providing power savings; and a wakeup circuit operatively connected to the peripheral bus, the wakeup circuit operates to detect bus events on the peripheral bus when the bus host controller is in the shutdown mode and to initiate awakening of the host bus controller to the operational mode when bus events have been detected.
As a computer system, another embodiment of the invention includes: a memory for storing at least instructions; a microprocessor for processing the instructions stored in the memory; a power manager for managing power consumption of the computer system; a peripheral bus; a bus host controller for managing data transfer over the peripheral bus, the bus host controller being shut-down when the peripheral bus is not needed; and a wakeup circuit operatively connected to the peripheral bus, the wakeup circuit operates to detect bus events on the peripheral bus when the bus host controller is shutdown and to initiate awakening of the host bus controller when bus events have been detected.
As a wakeup circuit for awakening a bus controller from a low-power mode, where the bus controller controls communications with a bus, an embodiment of the invention includes: an initial bus condition store that stores initial conditions residing on the bus when the wakeup circuit is activated; and event detection circuitry that detects at least one type of bus event on the bus based on current bus conditions and the initial conditions stored in the initial bus condition store.
As a wakeup circuit for awakening a bus controller from a low-power mode, where the bus controller controls communications with a bus, another embodiment of the invention includes: event detection circuitry that detects at least one type of bus event on the bus based on current bus conditions; and a wakeup signal generator that operates to produce a bus wakeup signal that is used in awakening the bus controller.
As a method for monitoring bus activity on a bus of a computing device when a bus controller for the bus is inactive, an embodiment of the invention includes the operations of: activating a bus monitor circuit when the bus controller becomes inactive; saving an initial bus state when the bus monitor circuit is activated; subsequently monitoring a current bus state of the bus using the bus monitor circuit to detect certain bus events occurring on the bus, the certain bus events being detected based on the initial bus state and the current bus state; and awakening the bus controller when at least one of the certain bus events are detected.
The advantages of the invention are numerous. Different embodiments or implementations may have one or more of the following advantages. One advantage of the invention is that bus events invoked on a bus by a peripheral device are able to be noticed and responded to even though bus circuitry is shut down (i.e., inactive state). Another advantage of the invention is that power management can be had for bus circuitry without loss of important bus events while the bus circuitry is shut down. Still another advantage of the invention is that resistance to noise present on the bus is provided so that bus events are not erroneously detected. Yet another advantage of the invention is that the particular type of event inducing the awakening of the bus circuitry can be made known to the computer system (e.g., operating system).
Other aspects and advantages of the invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, illustrating by way of example the principles of the invention.